package com.yy.yunpan.common.constant;

/**
 * 系统常量
 *
 * @author YY
 * @since 2025-10-01
 */
public class Constants {

    /**
     * JWT相关常量
     */
    public static final String JWT_SECRET = "yy-yunpan-secret-key-2025-jwt-hmac-sha256-secure";
    public static final String JWT_HEADER = "Authorization";
    public static final String JWT_PREFIX = "Bearer ";
    public static final long JWT_EXPIRE_TIME = 7 * 24 * 60 * 60 * 1000L; // 7天

    /**
     * Redis Key前缀
     */
    public static final String REDIS_PREFIX = "yunpan:";
    public static final String REDIS_USER_PREFIX = REDIS_PREFIX + "user:";
    public static final String REDIS_VERIFY_CODE_PREFIX = REDIS_PREFIX + "verify_code:";
    public static final String REDIS_FILE_PREFIX = REDIS_PREFIX + "file:";

    /**
     * 文件相关常量
     */
    public static final String OSS_BASE_PATH = "/yyyunpan/";
    public static final long DEFAULT_STORAGE_QUOTA = 5L * 1024 * 1024 * 1024; // 5GB
    public static final long MAX_FILE_SIZE = 10L * 1024 * 1024 * 1024; // 10GB
    public static final int RECYCLE_EXPIRE_DAYS = 30; // 回收站文件保存30天

    /**
     * 分享相关常量
     */
    public static final int SHARE_CODE_LENGTH = 8;
    public static final long SHARE_EXPIRE_TIME = 7 * 24 * 60 * 60 * 1000L; // 默认7天过期

    /**
     * 邮件相关常量
     */
    public static final int VERIFY_CODE_LENGTH = 6;
    public static final long VERIFY_CODE_EXPIRE_TIME = 5 * 60 * 1000L; // 5分钟过期

    /**
     * 分页相关常量
     */
    public static final int DEFAULT_PAGE_SIZE = 20;
    public static final int MAX_PAGE_SIZE = 100;

    /**
     * 文件类型常量
     */
    public static final class FileType {
        public static final String IMAGE = "image";
        public static final String VIDEO = "video";
        public static final String AUDIO = "audio";
        public static final String DOCUMENT = "document";
        public static final String OTHER = "other";
    }

    /**
     * 用户状态常量
     */
    public static final class UserStatus {
        public static final int NORMAL = 1;
        public static final int DISABLED = 0;
    }

    /**
     * 文件状态常量
     */
    public static final class FileStatus {
        public static final int NORMAL = 1;      // 正常
        public static final int RECYCLE = 0;     // 回收站
        public static final int DELETED = -1;    // 已删除
    }

    /**
     * 分享类型常量
     */
    public static final class ShareType {
        public static final int PUBLIC = 1;     // 公开分享
        public static final int PRIVATE = 2;    // 私密分享（需密码）
    }

    /**
     * 分享权限常量
     */
    public static final class SharePermission {
        public static final int VIEW = 1;       // 查看
        public static final int DOWNLOAD = 2;   // 下载
        public static final int MANAGE = 3;     // 管理
    }
}